<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录 - 外卖下单管理系统</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <link href="../static/bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet">
    <link href="../static/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="../static/css/style.min.css" rel="stylesheet">
    <script type="text/javascript" src="../static/js/jquery-3.2.1.js"></script>
    <style>
        .login-box {
            width: 30%;
            height: 300px;
            background-color: #afc1ff;
            border-radius: 4px;
            margin-top: 200px;
        }
        .login-body {
            padding: 20px 30px;
        }
        .form-group span {
            display: inline-block;
            width: 100px;
        }
    </style>
    <script>
        function login() {
            $.post(
                "/login",{
                    uid: $("#username").val(),
                    password: $("#password").val()
                },
                function (data, status) {
                    if (data.code == 0) {
                        window.location = "/index.html";
                    }
                }
            );
        }
    </script>
</head>
<body>
    <div class="container center-block login-box">
        <div class="card">
            <div class="card-header">
                <h3>登录</h3>
            </div>
            <div class="card-body login-body">
                <div class="form-inline">
                    <div class="form-group" style="margin-bottom: 20px">
                        <span>用户名：</span><input type="text" class="form-control" id="username" name="username">
                    </div>
                    <div class="form-group" style="margin-bottom: 23px">
                        <span>密码：</span><input type="password" class="form-control" id="password" name="password">
                    </div>
                </div>
                <hr />
                <button class="btn btn-success form-control" id="btn-login" onclick="login();">登录</button>
            </div>
        </div>
    </div>
</body>
</html>